import request from '@/config/axios'

// 用户关注 VO
export interface UserFollowVO {
  id: number // 主键
  userId: number // 用户ID
  followId: number // 关注的ID
  type: boolean // 关注的类型（0公寓 1现房）
}

// 用户关注 API
export const UserFollowApi = {
  // 查询用户关注分页
  getUserFollowPage: async (params: any) => {
    return await request.get({ url: `/business/user-follow/page`, params })
  },

  // 查询用户关注详情
  getUserFollow: async (id: number) => {
    return await request.get({ url: `/business/user-follow/get?id=` + id })
  },

  // 新增用户关注
  createUserFollow: async (data: UserFollowVO) => {
    return await request.post({ url: `/business/user-follow/create`, data })
  },

  // 修改用户关注
  updateUserFollow: async (data: UserFollowVO) => {
    return await request.put({ url: `/business/user-follow/update`, data })
  },

  // 删除用户关注
  deleteUserFollow: async (id: number) => {
    return await request.delete({ url: `/business/user-follow/delete?id=` + id })
  },

  // 导出用户关注 Excel
  exportUserFollow: async (params) => {
    return await request.download({ url: `/business/user-follow/export-excel`, params })
  },
}